<!DOCTYPE html>
<html lang="en">
<head>
  <meta charset="UTF-8">
  <meta name="viewport" content="width=device-width, initial-scale=1.0">
  <title>静态资源 {{ sub !== '/' ? '| ' + sub : ''}}</title>
  <style>
    .file-list{
      display: flex;
      align-items: center;
      border-bottom: 1px solid rgb(196, 196, 196);
      height: 30px;
    }
    .file-list a{
      flex: 1;
    }
    .file-list span{
      width: 100px;
    }
  </style>
</head>
<body>
  {{ if sub !== '/' }}
  <ul>
    <li><a href="/">返回首页</a></li>
    <li><a href="{{ '/' + sub.split('/').slice(1, -2).join('/') }}">{{ '返回上一级: /' + sub.split('/').slice(1, -2).join('/') }}</a></li>
  </ul>
  {{ /if }}
  {{ if list.length }}
  <ul>
    {{each list}}
      <li class="file-list">
        {{ if $value.isDir }}
          <a href="{{sub}}{{$value.path}}">/{{$value.path}}</a>
        {{ else }}
          <a href="{{sub}}{{$value.path}}" target="_blank">{{$value.path}}</a>
          <span>{{$value.size}}</span>
        {{ /if }}
      </li>
    {{ /each }}
  </ul>
  {{ else }}
  <ul>
    暂无内容
  </ul>
  {{ /if }}
</body>
</html>